#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
    int n = 0;
    cin >> n;
    //cerr<<n<<endl;
    vector<int> v(3 * n, 0);
    for (int i = 0;i < 3 * n;i++)
    {
        cin >> v[i];
    }
    //cerr<<endl;
    sort(v.begin(), v.end());
    // for(auto& a:v)
    // {
    //     cerr<<a<<" ";
    // }
    // cerr<<endl;
    long long count = 0;
    int j = 3 * n - 2;
    while (n--)
    {
        //cerr<<j<<" ";
        count += v[j];
        j -= 2;
    }
    //cerr<<endl;
    cout << count << endl;
    //cerr<<count<<endl;
    return 0;
}
